package cn.lovecyy.mockjson.core.funcs;

import cn.lovecyy.mockjson.core.domain.TypeConfig;

/**
 * ToStrFunc
 *
 * @author Yakir
 */
public class ToStrFunc implements FuncMock {

	@Override
	public String getFuncName() {
		return "toStr";
	}

	@Override
	public Object apply(TypeConfig config, String... args) {
		if (args == null || args.length < 1)
			return args != null && args.length > 0 ? args[0] : null;
		String val = args[0];
		return val;
	}

}
